import { createRouter, createWebHashHistory } from 'vue-router'

const router = createRouter({
  history: createWebHashHistory(), // hash模式：createWebHashHistory，history模式：createWebHistory
  routes: [
    {
      path: '/',
      redirect: '/home'
    },
    {
      path: '/home',
      name: 'home',
      component: () => import(/* webpackChunkName: "index" */ '../views/home/Home.vue')
    },
    {
      path: '/works',
      name: 'works',
      component: () => import(/* webpackChunkName: "index" */ '../views/works/Works.vue')
    },
    {
      path: '/wantsay',
      name: 'wantsay',
      component: () => import(/* webpackChunkName: "index" */ '../views/wantsay/Wantsay.vue')
    },
    {
      path: '/about',
      name: 'about',
      component: () => import(/* webpackChunkName: "index" */ '../views/about/About.vue')
    },
    {
      path: '/comment',
      name: 'comment',
      component: () => import(/* webpackChunkName: "index" */ '../views/comment/Comment.vue')
    },
    {
      path: '/back',
      name: 'back',
      component: () => import(/* webpackChunkName: "index" */ '../views/back/Back.vue')
    }
  ]
})

export default router